package cn.walls1717.ggkt.util;

/**
 * 获取登录用户信息类
 *
 * @author walls1717
 * @since 2022/7/22
 */
public class AuthContextHolder {

    /** 后台管理用户id */
    private static ThreadLocal<Long> adminId = new ThreadLocal<>();
    /** 会员用户id */
    private static ThreadLocal<Long> userId = new ThreadLocal<>();

    public static Long getAdminId() {
        return adminId.get();
    }

    public static void setAdminId(Long adminId1) {
        adminId.set(adminId1);
    }

    public static Long getUserId() {
        return userId.get();
    }

    public static void setUserId(Long userId1) {
        userId.set(userId1);
    }

    /**
     * 清除管理员id
     */
    public static void removeAdminId() {
        adminId.remove();
    }

    /**
     * 清除用户id
     */
    public static void removeUserId() {
        userId.remove();
    }

}
